<%@ page import="java.util.ArrayList" %>
<%@ page import="com.zhiyou.entity.Column" %><%--
  Created by IntelliJ IDEA.
  User: 磊布斯
  Date: 2021/9/1
  Time: 15:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <meta charset="utf-8">

    <link href="../css/main.css" rel="stylesheet">
</head>
<body>
<%
    ArrayList<Column> columnList = (ArrayList<Column>) session.getAttribute("columnList");
    String add = (String) session.getAttribute("columnAdd");
    String edit = (String) session.getAttribute("columnEdit");
    String delete = (String) session.getAttribute("deleteColumn");
    if ("success".equals(add)){
        %>
    <script type="text/javascript">
        alert("新增成功");
    </script>
<%
    }
    session.removeAttribute("columnAdd");
    if ("success".equals(edit)){
        %>
    <script type="text/javascript">
        alert("更新成功");
    </script>
<%
    }
    session.removeAttribute("columnEdit");
    if ("success".equals(delete)){
%>
    <script type="text/javascript">
        alert("删除成功")
    </script>
<%
    }
    session.removeAttribute("deleteColumn");
%>
<!-- 栏目管理 -->
<div class="AccountManagement_c" id="ColumnManagement_c">
    <h3>栏目管理
        <form action="../DoSearchServlet" method="post">
            <div class="amcl fr">
                <input type="text" placeholder="用户名" class="fl" name="">
                <button class="search fl"><img src="../images/search.png"></button>
            </div>
        </form>

    </h3>
    <div class="AM_ct text_center">
        <div class="AM_ct_in">
            <div class="add_btn  df_btn fl" id="add_column_btn">添加</div>
            <div class="edit_btn df_btn fl" id="edit_column_btn">编辑</div>
            <div class="delete_btn df_btn fl" id="delete_column_btn">删除</div>
        </div>
    </div>

    <div class="list">
        <ul class="list_h">
            <li class="b20"><label><input type="checkbox" name=""><span>序号</span></label></li>
            <li class="b80"><label>栏目名称</label></li>
        </ul>
        <div class="list_b_c">
            <%
                for (int i = 0; i < columnList.size() ; i++) {
            %>
                <ul class="list_b">
                <li class="b20"><label><input type="checkbox" name=""><span><%=columnList.get(i).getCid()%></span></label></li>
                <li class="b80"><label><%=columnList.get(i).getName()%></label></li>
                </ul>
                <%
                }
            %>

        </div>

        <%--<div class="pull_page">--%>
            <%--<div class="fl pull_page_up">上一页</div>--%>
            <%--<ul>--%>
                <%--<li class="on">1</li>--%>
                <%--<li>2</li>--%>
                <%--<li>3</li>--%>
                <%--<li>4</li>--%>
                <%--<li class="pull_page_df_btn">…</li>--%>
                <%--<li>12</li>--%>
            <%--</ul>--%>
            <%--<div class="fl pull_page_down">下一页</div>--%>
        <%--</div>--%>


    </div>
</div>


<!-- 添加栏目 -->
<form action="../ColumnAdd" method="post">
    <div class="add_Account dn" id="add_column">
        <div class="add_Account_c">
            <div class="add_Account_h">
                <div class="add_Account_h_in">
                    添加栏目
                    <span class="fr add_Account_close"><img src="../images/close.png"></span>
                </div>
            </div>
            <div class="user_name user_i">
                <label>栏目名</label> <input type="text" placeholder="输入栏目名" name="columname">
            </div>
            <div class="user_password user_i">
                <label>序<i>调</i>号</label> <input type="text" placeholder="输入序号" name="columnumb">
            </div>
            <button class="add_Account_ok_btn text_center" id="add_column_ok_btn">确<i>皮</i>定</button>
        </div>
    </div>
</form>


<!-- 编辑栏目 -->
<form action="../ColumnAlter" method="post">
    <div class="add_Account dn" id="edit_column">
        <div class="add_Account_c">
            <div class="add_Account_h">
                <div class="add_Account_h_in">
                    编辑栏目
                    <span class="fr add_Account_close"><img src="../images/close.png"></span>
                </div>
            </div>
            <div class="user_name user_i">
                <label>栏目名</label> <input type="text" placeholder="输入栏目名" name="columname">
            </div>
            <div class="user_password user_i">
                <label>序<i>调</i>号</label> <input type="text" placeholder="输入序号" name="columnumb" readonly="readonly">
            </div>
            <button class="add_Account_ok_btn text_center" id="edit_column_ok_btn">确<i>皮</i>定</button>
        </div>
    </div>
</form>


<!-- 删除栏目 -->
<form action="../ColumnDelete" method="post">
    <div class="add_Account dn" id="delete_column">
        <div class="add_Account_c">
            <div class="add_Account_h">
                <div class="add_Account_h_in">
                    删除栏目
                    <span class="fr add_Account_close"><img src="../images/close.png"></span>
                </div>
            </div>
            <div class="delete_text">确定删除序号为“ <span id="deleteColumnId"></span> ”的栏目吗？</div>
            <input type="text" style="display:none" name="deleteColumnId2"/>
            <button class="add_Account_ok_btn text_center" id="delete_column_ok_btn">确<i>皮</i>定</button>
        </div>
    </div>
</form>

<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/main.js"></script>
</body>
</html>
